﻿//
// Created: 2018/12/2
// Author: chenqiang
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xproject.Framework.Core;
using System.ComponentModel.DataAnnotations.Schema;

namespace Model.WXshopBuiness
{
    public class ShoppingCar : IEntity
    {

        ///<summary>
        ///
        ///<summary>
        public string ShopCarId { get; set; }
        ///<summary>
        ///
        ///<summary>
        public DateTime CreateTime { get; set; }

        public string StrCreateTime { get {
                return CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
            } }
        ///<summary>
        ///
        ///<summary>
        public string UserId { get; set; }
        ///<summary>
        ///
        ///<summary>
        public string ProductId { get; set; }
        ///<summary>
        ///单个商品价格
        ///<summary>
        public decimal SinglePrice { get; set; }

        public string StrSignlePrice { get {
                return SinglePrice.ToString("#0.00");
            } }
        public string StrAllMoney {
            get {
                return (SinglePrice * ProductNum).ToString("#0.00");
            }
        }
        ///<summary>
        ///此类商品数目
        ///<summary>
        public int ProductNum { get; set; }
        ///<summary>
        ///当前此购物车产品的状态，0 还没被生成订单，1已生成订单 
        ///<summary>
        public int ItemState { get; set; }
        ///<summary>
        ///
        ///<summary>
        public string ProductName { get; set; }
        ///<summary>
        ///
        ///<summary>
        public string ProductImgUrl { get; set; }
        ///<summary>
        ///
        ///<summary>
        public string ProductDesc { get; set; }
        ///<summary>
        ///
        ///<summary>
        public decimal SingleOrigPrice { get; set; }
        ///<summary>
        ///产品规格型号 同一个产品ID 不同规格型号 在购物车不算做一类
        ///<summary>
        public string ProductSpecificationId { get; set; }
        ///<summary>
        ///
        ///<summary>
        public string ProductSpecificationName { get; set; }
        public string ProductSpecificationNameStr {
            get {
                if (string.IsNullOrEmpty(ProductSpecificationId))
                {
                    return "(默认)";
                }
                return ProductSpecificationName;
            }
        }
       ///<summary>
       ///
       ///<summary>
       public DateTime UpdateTime  { get; set; } 
       ///<summary>
       ///
       ///<summary>
       public string Remarks  { get; set; } 
         
    /// <summary>
    /// 产品链接
    /// </summary>
        public string ProductUrl { get; set; }

       [NotMapped]
        public long Id { get; set; }

        [NotMapped]
        public EntityState EntityState { get; set; }

        public int CompareTo(object obj)
        {
            throw new NotImplementedException();
        }
    }
}